package aom.example.security.service.impl;

import aom.example.security.domain.SysMenuEntity;
import aom.example.security.mapper.SysMenuMapper;
import aom.example.security.service.SysMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Xiongx
 * @version 1.0
 * @date 2021/6/11 14:48
 * @since JDK 1.8
 */
@Service("sysMenuService")
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenuEntity> implements SysMenuService {

    @Override
    public List<Map<String, Object>> selectRoleMenuList(String keyword, Integer page, Integer size) {
        page=(page-1)*size;
        Map<String, Object> map=new HashMap<>();
        map.put("page",page);
        map.put("size",size);
        map.put("keyword",keyword);
        return this.baseMapper.selectMenuRoleList(map);
    }

    @Override
    public Integer selectRoleMenuListCount(String keyword) {
        Map<String, Object> map=new HashMap<>();
        map.put("keyword",keyword);
        return this.baseMapper.selectMenuRoleListCount(map);
    }


}
